package com.qipay.admin;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.core.type.filter.TypeFilter;

import java.io.IOException;

/**
 * admin排除扫描api项目特定的包，免得资源浪费
 */
public class TypeExcludeFilter implements TypeFilter {
    protected final Logger logger = LoggerFactory.getLogger(getClass());
    @Override
    public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) throws IOException {
        if(metadataReader.getClassMetadata().getClassName().contains("com.qipay.sp.excutor")
        ||metadataReader.getClassMetadata().getClassName().contains("com.qipay.pay")){
           return true;
         }
        return false;
    }
}
